package com.buwei.module.rbac.domain.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import com.buwei.module.rbac.domain.entity.Resource;

@Repository
public interface ResourceRepository extends JpaRepository<Resource, Long>,
	JpaSpecificationExecutor<Resource>{

	/**
	 * @Description : 此方法，可用来获取侧边栏菜单的 可展开、非路由 菜单项
	 */
	List<Resource> findByIsMenuAndCanRouteOrderBySortAsc(Boolean isMenu, Boolean canRoute);
	
	List<Resource> findByIsMenuAndPidOrderBySortAsc(Boolean isMenu, Long pid);
	
	Resource findByPath(String path);
	
}
